<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>simOpenTextEditor</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../../index.html" TARGET="_top"><img src="../images/homeImg.png"></a></p>

<h1>Regular API function</h1>
<h3 class=subsectionBar><a name="simOpenTextEditor" id="simOpenTextEditor"></a>simOpenTextEditor</h3>
<table class=apiTable>
<tr class=apiTableTr> 
<td class=apiTableLeftDescr>
Description 
</td> 
<td class=apiTableRightDescr>Opens a text edition window. The C version of this function opens a modal window, see <a href="simTextEditorOpen.htm">sim.textEditorOpen</a> for the Lua version of this function.</td>
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCSyn>
C synopsis
</td> 
<td class=apiTableRightCSyn>simChar* simOpenTextEditor(const simChar* initText,const simChar* xml,simInt* various)</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCParam>C parameters</td> 
<td class=apiTableRightCParam>
<div><strong>initText</strong>: a pointer to the initial text to be displayed.</div>
<div><strong>xml</strong>: a pointer to an XML description of the text editor's properties. Can be nullptr for default properties. Following is a valid content:</div><br>

<pre class=lightRedBoxNoMarginAndSmall>&lt;editor title=&quot;Window title&quot; editable=&quot;true&quot; searchable=&quot;true&quot;
  tabWidth=&quot;4&quot; textColor=&quot;50 50 50&quot; backgroundColor=&quot;190 190 190&quot;
  selectionColor=&quot;128 128 255&quot; size=&quot;800 600&quot; position=&quot;100 100&quot; &gt;

  &lt;keywords1 color=&quot;152 0 0&quot; &gt;
    &lt;item word=&quot;sim.getObjectHandle&quot; autocomplete=&quot;true&quot;
      calltip=&quot;number handle=sim.getObjectHandle(string path)&quot; /&gt;
    &lt;item word=&quot;sim.getObjectPosition&quot; autocomplete=&quot;true&quot;
      calltip=&quot;table[3] pos=sim.getObjectPosition(number handle,
        number relHandle)&quot; /&gt;
  &lt;/keywords1&gt;
  &lt;keywords2 color=&quot;220 80 20&quot; &gt;
    &lt;item word=&quot;sim.getObjectOrientation&quot; autocomplete=&quot;true&quot;
      calltip=&quot;table[3] euler=sim.getObjectOrientation(number handle,
        number relHandle)&quot; /&gt;
  &lt;/keywords2&gt;
&lt;/editor&gt;</pre>

Other <em>editor</em> attributes with their default values are:

<pre class=lightRedBoxNoMarginAndSmall>isLua=&quot;false&quot;
useSimKeywords=&quot;false&quot;
commentColor=&quot;0 140 0&quot;
numberColor=&quot;220 0 220&quot;
stringColor=&quot;255 255 0&quot;
characterColor=&quot;255 255 0&quot;
operatorColor=&quot;0 0 0&quot;
preprocessorColor=&quot;0 128 128&quot;
identifierColor=&quot;64 64 64&quot;
wordColor=&quot;0 0 255&quot;
word4Color=&quot;152 64 0&quot;</pre>

<div><strong>various</strong>: optional pointer holding the window size (various[0]-various[1]) and position (various[2],various[3]).</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCRet>
C return value
</td> 
<td class=apiTableRightCRet>
<div>nullptr in case of an error. Otherwise a pointer to the text. The user is in charge of releasing the returned buffer with <a href="simReleaseBuffer.htm">simReleaseBuffer</a>.</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLSyn>
Lua synopsis
</td> 
<td class=apiTableRightLSyn><div>DEPRECATED. See <a href="simTextEditorOpen.htm">sim.textEditorOpen</a> instead.</div></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLParam>Lua parameters</td> 
<td class=apiTableRightLParam>
<div></div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLRet>
Lua return values
</td> 
<td class=apiTableRightLRet>
<div></div>
</td> 
</tr> 
</table> 


<br>
</td>
</tr>
</table>
</div>
</body>
</html>
